-
Notifications
You must be signed in to change notification settings - Fork 326
[Instrumentation.AspNetCore] Handle cases where the HttpContext
is a property of the payload (ASP.NET Core 2.x support)
#2724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…onymous object (#4126)
@mathew-tolj, thank you for the contribution. Based on this Line 4 in d1e3207
This package was never intended to work with .NET Framework. In fact, it will not if we will do not have .NET Standard 2.0 target for all packages in contrib. What is your perspective on adding such support for this legacy stuff? @mathew-tolj , If other maintainers will be fine with extending support we need to do couple other things
|
I did notice that there weren't any existing tests for the .NET Standard target that this PR is for so that is why I had not pushed any changes to the test projects. It is pretty easy to add a test to the .NET 8 and 9 that tests extraction of the I have also attempted to add a .NET Framework target to the test projects and that is mostly working although it is not without it's own challenges and I am not sure if the code is of a good enough standard to push. As of now there are 3 remaining obstacles:
|
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
SIG update: We had a discussion on this PR 2 weeks back in the SIG. There are no plans to support ASP.NET Core 2.x, and this decision was made when the instrumentation library was built. Additionally, the proposed changes may not be sufficient to provide support for 2.x. Thanks for your contribution. |
Fixes open-telemetry/opentelemetry-dotnet#4126, open-telemetry/opentelemetry-dotnet#5019
Changes
Fixes an issue where using
OpenTelemetry.Instrumentation.AspNetCore
with ASP.NET Core 2.x (the only version still officially support on .NET Framework) does not export any metrics or traces for incoming requests. This is achieved by checking if theHttpContext
is a property of the payload in cases where the payload cannot be cast toHttpContext
directly. This allowsOpenTelemetry.Instrumentation.AspNetCore
to continue processing the event instead of short circuiting.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes